# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=kubectl-cert-manager
pkgver=1.14.4
pkgrel=2
pkgdesc="Manage and configure cert-manager resources for Kubernetes"
url="https://cert-manager.io/"
license="Apache-2.0"
arch="all !armhf !riscv64" # limited by kubectl
depends="kubectl"
makedepends="go"
source="https://github.com/cert-manager/cert-manager/archive/v$pkgver/kubectl-cert-manager-$pkgver.tar.gz"
builddir="$srcdir/cert-manager-$pkgver/cmd/ctl"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build \
		-ldflags "-X github.com/cert-manager/cert-manager/pkg/util.AppVersion=v$pkgver"
}

check() {
	go test ./...
}

package() {
	install -Dm755 ctl "$pkgdir"/usr/bin/kubectl-cert_manager
}

sha512sums="
3f3af43223093ce058a1dee8ae1e1e52dd90029cbd537860754f0cdff9ccb030041ebd65402ecd4e44ee6fde69a3748b622e77d8af4907d7f696f04d8c72c762  kubectl-cert-manager-1.14.4.tar.gz
"
